<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/maa.tld" prefix="m" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:setLocale value="${language}"/>
<fmt:bundle basename="messages" prefix="registration.">
    <html>
    <head>
        <title><fmt:message key="title"/></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width">
        <link rel="stylesheet" href="${pageContext.servletContext.contextPath}/static/bootstrap/css/bootstrap.css">
        <link href="${pageContext.request.contextPath}/css/registration.css" rel="stylesheet">
        <link rel="shortcut icon" href="${pageContext.servletContext.contextPath}/static/yin.ico">
        <script type="text/javascript"
                src="${pageContext.servletContext.contextPath}/static/bootstrap/js/bootstrap.min.js"></script>
        <style type="text/css"></style>
    </head>
    <body>
    <div class="navbar-wrapper">
        <div class="container-fluid">
            <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
                <div class="container">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle" data-toggle="collapse"
                                data-target=".navbar-collapse">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="/maa/do?action=main"> <img
                                src="${pageContext.servletContext.contextPath}/static/ics.png"/>Silver Dragon</a>
                    </div>
                    <div class="navbar-collapse collapse">
                        <ul class="nav navbar-nav navbar-right">
                            <li><a href="/maa/do?action=main"><fmt:message key="main"/></a></li>

                            <m:language/>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container">
        <form class="form-signin" action="/maa/do" method="post">
            <h2 class="form-signin-heading"><fmt:message key="fillin"/></h2>

            <c:if test="${not empty incorrect_email}">
                <%=request.getAttribute("incorrect_email")%>
            </c:if>
            <c:if test="${not empty incorrect_name}">
                <%=request.getAttribute("incorrect_name")%>
            </c:if>
            <c:if test="${not empty incorrect_surname}">
                <%=request.getAttribute("incorrect_surname")%>
            </c:if>
            <c:if test="${not empty incorrect_gender}">
                <%=request.getAttribute("incorrect_gender")%>
            </c:if>
            <c:if test="${not empty incorrect_birthdate}">
                <%=request.getAttribute("incorrect_birthdate")%>
            </c:if>
            <c:if test="${not empty unmatching_passwords}">
                <%=request.getAttribute("unmatching_passwords")%>
            </c:if>
            <c:if test="${not empty incorrect_password}">
                <%=request.getAttribute("incorrect_password")%>
            </c:if>
            <p><fmt:message key="email"/></p>
            <input type="text" name="email" class="form-control input-lg"
                   placeholder="example@example.com" required
            <c:if test="${not empty em}"> value="<%=request.getAttribute("em")%>"
            </c:if>>

            <p><fmt:message key="name"/></p>
            <input type="text" name="name" class="form-control" placeholder="<fmt:message key="nameholder"/>" required
            <c:if test="${not empty na}"> value="<%=request.getAttribute("na")%>"
            </c:if>>

            <p><fmt:message key="surname"/></p>
            <input type="text" name="surname" class="form-control" placeholder="<fmt:message key="surnameholder"/>"
                   required
            <c:if test="${not empty sur}"> value="<%=request.getAttribute("sur")%>"
            </c:if>>

            <p><fmt:message key="gender"/></p>

            <select id="gender" name="gender" class="form-control">
                <option value="male" selected><fmt:message key="male"/></option>
                <option value="female"><fmt:message key="female"/></option>
            </select>

            <p><fmt:message key="birthdate"/></p>
            <input type="date" name="birthdate" class="form-control" required>

            <p><fmt:message key="password"/></p>
            <input type="password" name="password" class="form-control" placeholder="<fmt:message key="pasph"/>"
                   required>

            <p><fmt:message key="rp"/></p>
            <input type="password" name="password_check" class="form-control" placeholder="<fmt:message key="rpasph"/>"
                   required>
            <button class="btn btn-lg btn-block btn-default" type="submit"><fmt:message key="register"/></button>
            <input type="hidden" name="action" value="register">
        </form>
        <form class="form-signin" action="/maa/do" method="get">
            <button class="btn btn-lg btn-block btn-default" type="submit"><fmt:message key="return"/></button>
            <input type="hidden" name="action" value="main">
        </form>
    </div>
    </body>

    </html>

</fmt:bundle>